package pers.twf.twfRpc.config;

import lombok.Data;
import pers.twf.twfRpc.fault.retry.RetryStrategyKeys;
import pers.twf.twfRpc.fault.tolerant.TolerantStrategyKeys;
import pers.twf.twfRpc.loadbalancer.LoadBalancerKeys;
import pers.twf.twfRpc.serializer.SerializerKeys;

import java.io.Serializable;

/**
 * RPC框架配置
 */
@Data
public class RpcConfig {

    private String name = "twf-rpc";

    private String version = "1.0";

    private String serviceHost = "127.0.0.1";

    private Integer servicePort = 8081;
    /**
     * 模拟调用
     */
    private boolean mock = false;

    private String serializer = SerializerKeys.JDK;

    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();

    /**
     * 负载均衡
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;

    /**
     * 重试策略
     */
    private String retryStrategy = RetryStrategyKeys.NO;

    /**
     * 容错策略
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
